

package org.pizza.rocket.core.annotation;

import org.springframework.stereotype.Component;

import java.lang.annotation.*;

/**
 * 生产者事务监听器注解
 * @author kynb_club
 * email kynb_club@163.com
 */
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
public @interface RocketTransactionListener {
    String NAME_SERVER_PLACEHOLDER = "${rocketmq.name-srv-addr:}";
    String ACCESS_KEY_PLACEHOLDER = "${rocketmq.access-key:}";
    String SECRET_KEY_PLACEHOLDER = "${rocketmq.secret-key:}";
    /**
     * 用于映射 TransactionProducerBean
     */
    String producerGroup();

    /**
     * Set ExecutorService params -- corePoolSize
     */
    int corePoolSize() default 1;

    /**
     * Set ExecutorService params -- maximumPoolSize
     */
    int maximumPoolSize() default 1;

    /**
     * Set ExecutorService params -- keepAliveTime
     */
    long keepAliveTime() default 1000 * 60; //60ms

    /**
     * Set ExecutorService params -- blockingQueueSize
     */
    int blockingQueueSize() default 2000;

    /**
     * The property of "access-key"
     */
    String accessKey() default ACCESS_KEY_PLACEHOLDER;

    /**
     * The property of "secret-key"
     */
    String secretKey() default SECRET_KEY_PLACEHOLDER;

    /**
     * The property of "nameServer".
     */
    String nameServer() default NAME_SERVER_PLACEHOLDER;
}
